.class public Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;
.super Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;
.source "FullscreenOverlayContainer.java"

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Landroid/view/View;",
        ":",
        "Lcom/burstly/lib/component/networkcomponent/IActivityLifeCycleAware;",
        ">",
        "Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer",
        "<TT;>;",
        "Landroid/view/View$OnClickListener;",
        "Ljava/lang/Runnable;"
    }
.end annotation


# static fields
.field private static final MILLISECONDS_IN_SECOND:I = 0x3e8


# instance fields
.field mCloseButtonActivationTimeout:I

.field protected final mHandler:Landroid/os/Handler;

.field private mHasDefaultFullscreenFlag:Z

.field private mHasDefaultNoLimitFlag:Z

.field private mInterstitialShowtime:Ljava/lang/Integer;

.field private final mNetworkName:Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/view/View;Ljava/lang/String;)V
    .locals 1
    .parameter
    .parameter "name"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;",
            "Ljava/lang/String;",
            ")V"
        }
    .end annotation

    .prologue
    .line 86
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    .local p1, child:Landroid/view/View;,"TT;"
    invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    check-cast v0, Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {v0}, Landroid/view/Window;->getDecorView()Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup;

    invoke-direct {p0, v0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;-><init>(Landroid/view/ViewGroup;Landroid/view/View;)V

    .line 87
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHandler:Landroid/os/Handler;

    .line 88
    iput-object p2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mNetworkName:Ljava/lang/String;

    .line 89
    return-void
.end method


# virtual methods
.method protected addChildToLayout(Landroid/view/ViewGroup;Landroid/view/View;)Landroid/view/View;
    .locals 6
    .parameter "containerLayout"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/view/ViewGroup;",
            "TT;)",
            "Landroid/view/View;"
        }
    .end annotation

    .prologue
    .line 93
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    .local p2, childView:Landroid/view/View;,"TT;"
    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mNetworkName:Ljava/lang/String;

    invoke-static {v2}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyFullscreenActivity;->getDecorator(Ljava/lang/String;)Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyFullscreenActivity$IDecorator;

    move-result-object v0

    .line 94
    .local v0, decor:Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyFullscreenActivity$IDecorator;
    if-nez v0, :cond_0

    .line 95
    new-instance v0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer$1;

    .end local v0           #decor:Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyFullscreenActivity$IDecorator;
    invoke-direct {v0, p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer$1;-><init>(Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;)V

    .line 107
    .restart local v0       #decor:Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyFullscreenActivity$IDecorator;
    :cond_0
    invoke-interface {v0, p2, p0}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyFullscreenActivity$IDecorator;->decorate(Landroid/view/View;Lcom/burstly/lib/component/networkcomponent/burstly/IOverlayContainer;)Landroid/view/View;

    move-result-object v1

    .line 108
    .local v1, decorated:Landroid/view/View;
    if-nez v1, :cond_1

    .line 109
    sget-object v2, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v3, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->TAG:Ljava/lang/String;

    const-string v4, "Decorate view is null! Will use original one."

    const/4 v5, 0x0

    new-array v5, v5, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v4, v5}, Lcom/burstly/lib/util/LoggerExt;->logWarning(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 110
    move-object v1, p2

    .line 112
    :cond_1
    const/16 v2, 0x82

    invoke-virtual {p2, v2}, Landroid/view/View;->requestFocus(I)Z

    .line 113
    invoke-virtual {p1, v1}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V

    .line 114
    return-object v1
.end method

.method protected createCloseableContainer()Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 123
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    new-instance v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;-><init>(Landroid/content/Context;)V

    .line 124
    .local v0, closeableContainer:Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer<TT;>;"
    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;->setBackgroundColor(I)V

    .line 125
    return-object v0
.end method

.method protected createContainerLayout()Landroid/view/ViewGroup;
    .locals 2

    .prologue
    .line 130
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    new-instance v0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer$2;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer$2;-><init>(Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;Landroid/content/Context;)V

    .line 154
    .local v0, layout:Landroid/widget/FrameLayout;
    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setBackgroundColor(I)V

    .line 155
    return-object v0
.end method

.method public getCloseButtonActivationTimeout()I
    .locals 1

    .prologue
    .line 258
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    iget v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mCloseButtonActivationTimeout:I

    return v0
.end method

.method public getInterstitialShowtime()Ljava/lang/Integer;
    .locals 1

    .prologue
    .line 238
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mInterstitialShowtime:Ljava/lang/Integer;

    return-object v0
.end method

.method public hideOverlayed()V
    .locals 2

    .prologue
    .line 188
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->isShowing()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 189
    invoke-super {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;->hideOverlayed()V

    .line 191
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->getContext()Landroid/content/Context;

    move-result-object v1

    check-cast v1, Landroid/app/Activity;

    invoke-virtual {v1}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v0

    .line 192
    .local v0, window:Landroid/view/Window;
    iget-boolean v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHasDefaultFullscreenFlag:Z

    if-nez v1, :cond_0

    .line 193
    const/16 v1, 0x400

    invoke-virtual {v0, v1}, Landroid/view/Window;->clearFlags(I)V

    .line 195
    :cond_0
    iget-boolean v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHasDefaultNoLimitFlag:Z

    if-nez v1, :cond_1

    .line 196
    const/16 v1, 0x200

    invoke-virtual {v0, v1}, Landroid/view/Window;->clearFlags(I)V

    .line 198
    :cond_1
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHandler:Landroid/os/Handler;

    invoke-virtual {v1, p0}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    .line 200
    .end local v0           #window:Landroid/view/Window;
    :cond_2
    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 0
    .parameter "v"

    .prologue
    .line 207
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->hideOverlayed()V

    .line 208
    return-void
.end method

.method public onPause(Landroid/app/Activity;)V
    .locals 1
    .parameter "curerntActivity"

    .prologue
    .line 220
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    invoke-super {p0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;->onPause(Landroid/app/Activity;)V

    .line 221
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, p0}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    .line 222
    return-void
.end method

.method public onResume(Landroid/app/Activity;)V
    .locals 3
    .parameter "curerntActivity"

    .prologue
    .line 226
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    invoke-super {p0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;->onResume(Landroid/app/Activity;)V

    .line 227
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->getInterstitialShowtime()Ljava/lang/Integer;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 228
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHandler:Landroid/os/Handler;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->getInterstitialShowtime()Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    mul-int/lit16 v1, v1, 0x3e8

    int-to-long v1, v1

    invoke-virtual {v0, p0, v1, v2}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 230
    :cond_0
    return-void
.end method

.method public run()V
    .locals 0

    .prologue
    .line 215
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->hideOverlayed()V

    .line 216
    return-void
.end method

.method public setCloseButtonActivationTimeout(I)V
    .locals 0
    .parameter "closeButtonActivationTimeout"

    .prologue
    .line 267
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    iput p1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mCloseButtonActivationTimeout:I

    .line 268
    return-void
.end method

.method public setInterstitialShowtime(Ljava/lang/Integer;)V
    .locals 1
    .parameter "overlayShowTime"

    .prologue
    .line 247
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Ljava/lang/Integer;->intValue()I

    move-result v0

    if-lez v0, :cond_0

    .line 248
    iput-object p1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mInterstitialShowtime:Ljava/lang/Integer;

    .line 250
    :cond_0
    return-void
.end method

.method public showOverlayed()V
    .locals 6

    .prologue
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer<TT;>;"
    const/4 v3, 0x1

    const/4 v4, 0x0

    .line 163
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->isShowing()Z

    move-result v2

    if-nez v2, :cond_5

    .line 164
    invoke-super {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;->showOverlayed()V

    .line 165
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->getContext()Landroid/content/Context;

    move-result-object v2

    check-cast v2, Landroid/app/Activity;

    invoke-virtual {v2}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v1

    .line 166
    .local v1, window:Landroid/view/Window;
    invoke-virtual {v1}, Landroid/view/Window;->getAttributes()Landroid/view/WindowManager$LayoutParams;

    move-result-object v0

    .line 167
    .local v0, attributes:Landroid/view/WindowManager$LayoutParams;
    iget v2, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

    and-int/lit16 v2, v2, 0x400

    if-eqz v2, :cond_3

    move v2, v3

    :goto_0
    iput-boolean v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHasDefaultFullscreenFlag:Z

    .line 168
    iget-boolean v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHasDefaultFullscreenFlag:Z

    if-nez v2, :cond_0

    .line 169
    const/16 v2, 0x400

    invoke-virtual {v1, v2}, Landroid/view/Window;->addFlags(I)V

    .line 171
    :cond_0
    iget v2, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

    and-int/lit16 v2, v2, 0x200

    if-eqz v2, :cond_4

    :goto_1
    iput-boolean v3, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHasDefaultNoLimitFlag:Z

    .line 172
    iget-boolean v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHasDefaultNoLimitFlag:Z

    if-nez v2, :cond_1

    .line 173
    const/16 v2, 0x200

    invoke-virtual {v1, v2}, Landroid/view/Window;->addFlags(I)V

    .line 175
    :cond_1
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->getInterstitialShowtime()Ljava/lang/Integer;

    move-result-object v2

    if-eqz v2, :cond_2

    .line 176
    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->mHandler:Landroid/os/Handler;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->getInterstitialShowtime()Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I

    move-result v3

    mul-int/lit16 v3, v3, 0x3e8

    int-to-long v3, v3

    invoke-virtual {v2, p0, v3, v4}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 181
    .end local v0           #attributes:Landroid/view/WindowManager$LayoutParams;
    .end local v1           #window:Landroid/view/Window;
    :cond_2
    :goto_2
    return-void

    .restart local v0       #attributes:Landroid/view/WindowManager$LayoutParams;
    .restart local v1       #window:Landroid/view/Window;
    :cond_3
    move v2, v4

    .line 167
    goto :goto_0

    :cond_4
    move v3, v4

    .line 171
    goto :goto_1

    .line 179
    .end local v0           #attributes:Landroid/view/WindowManager$LayoutParams;
    .end local v1           #window:Landroid/view/Window;
    :cond_5
    sget-object v2, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v3, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->TAG:Ljava/lang/String;

    const-string v5, "Can not show overlayed view due its top most parent has not been set before."

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v5, v4}, Lcom/burstly/lib/util/LoggerExt;->logWarning(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_2
.end method
